home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
stazsoftware.com
/
www.stazsoftware.com.tar
/
www.stazsoftware.com
/
futurebasic
/
sample-code
/
helpProj.sit
/
Help Project Folder
/
MICN.INCL
< prev
next >
Wrap
Text File
|
2005-04-15
|
3KB
|
174 lines
'~'1
/*
MICN filter written for My Calendar
Adapted for use with FB^3
Created Feb 03 Date { 2/11/03 }
*/
'~'1
END GLOBALS
GOTO "MICN.FLTR"
'~'1
CLEAR LOCAL
dim cicnHndl&,elem
'~'2
LOCAL FN MICNclick
'~'2
LONG IF gObjUserTp& = _"MICN"
fn pgBlackAndWhite
elem = gWhichObjElem
FN pGgetObj(WINDOW(_outputWClass),1)
GetCPixel(1,1,@gObjBRed)
CALL RGBFORECOLOR(gObjBRed)
FN pGgetObj(WINDOW(_outputWClass),elem)
cicnHndl& = FN GETCICON(gObjUser1)
paintRECT(gObjT)
OFFSETRECT(gObjT,3,3)
PLOTCICON(gObjT,cicnHndl&)
FLUSHWINDOWBUFFeR
WHILE FN BUTTON
WEND
paintRECT(gObjT)
OFFSETRECT(gObjT,-3,-3)
PLOTCICON(gObjT,cicnHndl&)
FLUSHWINDOWBUFFeR
DISPOSCICON(cicnHndl&)
FORECOLOR(_Blackcolor)
insetrect(gObjT,-3,-3)
fn invalrect(gObjT)
END IF
END FN
CLEAR LOCAL
dim picrect as rect
dim Hndl&
DIM x,y,pct,h,w
dim @fnt
DIM t$
'~'2
LOCAL FN showtool
'~'2
Hndl& = FN getresource(_"PICT",gObjUser1)
gObjUser1 = 1
gObjUser2 = 1
long if Hndl&
insetrect(gObjT,1,1)
picrect;8 = @Hndl&..picFrame%
w = picrect.right - picrect.left
h = picrect.bottom - picrect.top
x = gObjL + (gObjR-gObjL)/2 - w/2
y = gObjT + (gObjB-gObjT)/2 - h/2
picture (x,y),Hndl&
end if
END FN
CLEAR LOCAL
dim cicnHndl&
DIM x,y
dim @fnt
DIM t$
'~'2
LOCAL FN PlotIconTool
'~'2
cicnHndl& = FN GETCICON(gObjUser1)
PLOTCICON(gObjT,cicnHndl&)
DISPOSCICON(cicnHndl&)
t$ = STR#(_baseID,gObjElement)
getfnum("Arial Bold",fnt)
text fnt,9,,1
x = (gObjL + (gObjR-gObjL)/2) - FN STRINGWIDTH(t$)/2
y = gObjB + USR FONTHEIGHT
forecolor(_blackcolor)
PRINT%(x,y)t$
END FN
'~'2
LOCAL FN I3cursor
'~'2
DIM where,inICN3,newCurs,oldCurs
DIM oldPoint&,oldClass,oldOut,obj,wRef
DIM @wPtr&
where = FN FINDWINDOW(gWhereY,wPtr&)
LONG IF where = _inContent
oldCurs = SYSTEM(_lastCurs)
newCurs = oldCurs
inICN3 = _false
LONG IF fn IsWindowHilited(wptr&)///PEEK(wPtr&+_wHilited)
wRef = USR WPTR2WNUM(wPtr&)
LONG IF wRef
oldClass = gWhichClass
oldPoint& = gMouseLong&
gMouseLong& = gWhereLong&
oldOut = WINDOW(_outputWnd)
WINDOW OUTPUT wRef
gWhichClass = WINDOW(_outputWClass)
CALL GLOBALTOLOCAL(gMouseLong&)
WINDOW OUTPUT oldOut
obj = FN pGpointInObj
LONG IF obj
FN pGgetObj(gWhichClass,obj)
LONG IF gObjUserTp& = _"ICN3"
inICN3 = (gObjUser1 = 1)
END IF
'~':
LONG IF gObjUserTp& = _"MICN" or gObjUserTp& = _"Tool"
inICN3 = _TRUE
END IF
'~':
END IF
gMouseLong& = oldPoint&
gWhichClass = oldClass
END IF
END IF
LONG IF inICN3
newCurs = _fingerCursor
gI3CursorFlag = _zTrue
XELSE
LONG IF gI3CursorFlag
IF oldCurs = _fingerCursor THEN newCurs = _arrowCursor
gI3CursorFlag = _false
END IF
END IF
IF oldCurs <> newCurs THEN CURSOR newCurs
END IF
END FN
"MICN.FLTR"
'~'2"MICN.FLTR"
'~'2
SELECT gLongAction&
CASE _oNull
FN I3cursor
CASE _oUserUpdate
IF gObjUserTp& = _"MICN" then FN PlotIconTool
IF gObjUserTp& = _"Tool" then fn showtool
CASE _oUserClick
IF gObjUserTp& = _"MICN" then FN MICNclick
END SELECT
'~'2
IF 0 THEN RETURN